#include "Vector3D.h"	

namespace collisions
{
	Vector3D::Vector3D()
	{
		X = 0;
		Y = 0;
		Z = 0;
	}
	Vector3D::Vector3D(const float _X, const float _Y, const float _Z)
	{
		X = _X;
		Y = _Y;
		Z = _Z;
	};
	const Vector3D& Vector3D::operator +(const Vector3D& oV)
	{
		const Vector3D& jad = Vector3D(X + oV.X, Y + oV.Y, Z + oV.Z);
		return jad;
	};
	const Vector3D& Vector3D::operator -(const Vector3D& oV)
	{
		const Vector3D& jad = Vector3D(X - oV.X, Y - oV.Y, Z - oV.Z);
		return jad;
	};
	Vector3D Vector3D::operator -() const
	{
		const Vector3D jad = Vector3D(-X, -Y, -Z);
		return jad;
	};
	const Vector3D& Vector3D::operator *(const float& a)
	{
		const Vector3D& jad = Vector3D(X * a, Y * a, Z * a);
		return jad;
	};
	const Vector3D& Vector3D::operator/(const float& a)
	{
		const Vector3D& jad = Vector3D(X / a, Y / a, Z / a);
		return jad;
	};
	void Vector3D::operator +=(const Vector3D& oV)
	{
		X += oV.X;
		Y += oV.Y;
		Z += oV.Z;
	};
	void Vector3D::operator *=(const float& a)
	{
		X *= a;
		Y *= a;
		Z *= a;
	};
	void Vector3D::operator /=(const float& a)
	{
		X /= a;
		Y /= a;
		Z /= a;
	};
	float Vector3D::lengthSquared()
	{
		return X * X + Y * Y + Z * Z;
	};
	float Vector3D::length()
	{
		return sqrtf(X * X + Y * Y + Z * Z);
	};
}